package com.taoym.voucher.admin.controller;

import com.taoym.voucher.admin.entity.dto.XcxActivityOrdersDTO;
import com.taoym.voucher.admin.entity.vo.XcxGetActivityOrdersVO;
import com.taoym.voucher.admin.service.XcxActivityOrderService;
import com.taoym.voucher.common.response.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @coder taoym
 * @datetime 2021/6/28 17:57
 * @desc
 */
@Api(tags = "活动订单控制器")
@RestController
@RequestMapping("/xcx/order")
public class XcxActivityOrderController {

    @Autowired
    private XcxActivityOrderService xcxActivityOrderService;

    @ApiOperation("查询订单列表")
    @GetMapping("/list")
    public Response<XcxGetActivityOrdersVO> listActivityOrder(XcxActivityOrdersDTO data) {
        return Response.success(xcxActivityOrderService.getOrderList(data));
    }

    @ApiOperation("同步历史订单")
    @GetMapping("/sync")
    public Response<Integer> syncHistoryOrder() {
        return Response.success(xcxActivityOrderService.syncHistoryOrder());
    }
}
